<template>
  <div id="ClassifyList">
    <app-header :name="name"></app-header>
    <list :list="dataList.cellphone" :dataIndex="dataIndex"></list>
  </div>
</template>

<script>
import Header from '@/components/Common/Header'
import list from '@/components/Classify/list'
export default {
  name: 'ClassifyList',
  components: {
    'app-header': Header,
    list
  },
  data () {
    return {
      name: 'ClassifyList',
      data: '',
      dataList: '',
      getTitle: '',
      dataIndex: ''
    }
  },
  mounted () {
    this.getdata()
  },
  methods: {
    getdata () {
      this.axios.get('../../../static/json/list.json').then(item => {
        this.data = item.data.data
        this.data.forEach((items, index) => {
          if (this.getTitle === items.title) {
            this.dataList = items
            this.dataIndex = index
          }
        })
      })
      this.getTitle = JSON.parse(localStorage.getItem('classify'))
    }
  }
}
</script>

<style scoped>
</style>
